<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>HH_GET_LAST_ERROR command</TITLE>
<style>@import url(coUA.css);</style>
<link disabled rel="stylesheet" href="htmlhelp.css">
</head>

<BODY>

<h1>HH_GET_LAST_ERROR command</h1>

<p>Returns information about the last error that occurred in the HTML Help ActiveX control (Hhctrl.ocx). </p>

<br>
<table border=1 cellpadding=3 cellspacing=0 width=100%>
<TR VALIGN="top">
<TH><I>pszFile</I></TH>
<TH><I>dwData</I></TH>
</TR>

<TR VALIGN="top">
<TD>
Must be NULL.
</TD>
<TD>
A pointer to a <a href="str_hh_last_error.htm">HH_LAST_ERROR</a> structure.
</TD>
</TR>
</TABLE>
<BR>

<H2>Example</H2>
<p><pre><code>
USES_CONVERSIONS; // For Unicode to ANSI string conversion
<br>
<br>HH_LAST_ERROR lasterror ;
<br>
<br>HWND hwnd = HtmlHelp(
<br>                     hOwner, 
<br>                     NULL, 
<br>                     HH_GET_LAST_ERROR,
<br>                     reinterpret_cast&lt;DWORD&gt;(&lasterror)) ;
<br>
<br>// Make sure that HH_GET_LAST_ERROR succeeded.
<br>if (hwnd != 0)
<br>{
<br>	// Only report an error if we found one:
<br>	if (FAILED(lasterror.hr))
<br>	{
<br>		// Is there a text message to display...
<br>		if (lasterror.description)
<br>		{
<br>			// Convert the String to ANSI
<br>			TCHAR* pDesc = OLE2T(lasterror.description) ;
<br>			::SysFreeString(lasterror.description) ;
<br>
<br>			// Display
<br>			MessageBox(hOwner, pDesc, 
<br>                       "Help Error", MB_OK) ;
<br>		}
<br>	}
<br>}
</pre></code></p>

<H2>Return value</H2>
<ul>
<li>On failure, zero.
<li>On success, non zero.
</li>
</ul>


<H2>Comments</H2>
<ul>
<li>There is no user interface (UI) associated with this command. The caller is responsible for returning error codes and text to a UI, such as a message box or a text file, and/or responding to an error.</li>

<li>This command reports on a limited range of possible errors. If a call to HtmlHelp() returns NULL, <b>HH_GET_LAST_ERROR</b> may not always report an error.
</li>
</ul>

<br>
<table border="0" cellpadding="0" cellspacing="4">
<tr>
<td valign="top"><a href="ov_about_htmlhelp_commands.htm"><img src="home.gif" width=20 height=18 alt="link to overview topic" border="0"></a>
</td>
<td><a href="ov_about_htmlhelp_commands.htm">About commands</A>
</td>
</tr>
<tr>
<td>&nbsp;
</td>
</tr>
</table>


<br>
<!--start keywords--->

<!--end keywords--->


</BODY>
</HTML>
